package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                                                                                                                                                                                                                                                                                                                                                    import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.RuleInNextStepMapper;
import com.ruoyi.bizsys.domain.RuleInNextStep;
import com.ruoyi.bizsys.service.IRuleInNextStepService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 规则引擎nextStep补充入参Service业务层处理
 *
 * @author african-loan
 * @date 2021-12-30
 */
@Service
public class RuleInNextStepServiceImpl extends ServiceImpl<RuleInNextStepMapper,RuleInNextStep> implements IRuleInNextStepService {

    /**
     * 查询规则引擎nextStep补充入参
     *
     * @param id 规则引擎nextStep补充入参ID
     * @return 规则引擎nextStep补充入参
     */
    @Override
    public RuleInNextStep selectRuleInNextStepById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询规则引擎nextStep补充入参列表
     *
     * @param ruleInNextStep 规则引擎nextStep补充入参
     * @return 规则引擎nextStep补充入参
     */
    @Override
    public List<RuleInNextStep> selectRuleInNextStepList(RuleInNextStep ruleInNextStep) {
        return this.list(new QueryWrapper<>(ruleInNextStep).last("order by id desc"));
    }

    /**
     * 新增规则引擎nextStep补充入参
     *
     * @param ruleInNextStep 规则引擎nextStep补充入参
     * @return 结果
     */
            @Override
    public int insertRuleInNextStep(RuleInNextStep ruleInNextStep) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ruleInNextStep.setCreateTime(DateUtils.getNowDate());
                                                return baseMapper.insert(ruleInNextStep);
    }

    /**
     * 修改规则引擎nextStep补充入参
     *
     * @param ruleInNextStep 规则引擎nextStep补充入参
     * @return 结果
     */
            @Override
    public int updateRuleInNextStep(RuleInNextStep ruleInNextStep) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ruleInNextStep.setUpdateTime(DateUtils.getNowDate());
                            return baseMapper.updateById(ruleInNextStep);
    }

    /**
     * 批量删除规则引擎nextStep补充入参
     *
     * @param ids 需要删除的规则引擎nextStep补充入参ID
     * @return 结果
     */
            @Override
    public int deleteRuleInNextStepByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除规则引擎nextStep补充入参信息
     *
     * @param id 规则引擎nextStep补充入参ID
     * @return 结果
     */
    @Override
    public int deleteRuleInNextStepById(Long id) {
        return baseMapper.deleteById(id);
    }

}
